package de.piratech.dasding.data.database.mongo.data;

import net.vz.mongodb.jackson.DBRef;
import de.piratech.dasding.data.ActionApplication;
import de.piratech.dasding.data.ActionApplication.STATUS;
import de.piratech.dasding.data.database.mongo.AbstractMongoDB.COLLECTIONS;

public class MongoActionApplication extends
    AbstractMongoDataObject<ActionApplication> {

  private DBRef<MongoAction, String> actionRef;;

  public MongoActionApplication() {
    super(new ActionApplication());
  }

  public MongoActionApplication(ActionApplication object) {
    super(object);
    if (object.getAction() != null) {
      actionRef = new DBRef<MongoAction, String>(object.getAction().getId(),
          COLLECTIONS.ACTION_COLLECTION.getName());
    }
  }

  public STATUS getStatus() {
    return getDataObject().getStatus();
  }

  public void setStatus(STATUS pStatus) {
    getDataObject().setStatus(pStatus);
  }

  public DBRef<MongoAction, String> getAction() {
    return actionRef;
  }

  public void setAction(DBRef<MongoAction, String> pAction) {
    actionRef = pAction;
    getDataObject().setAction(pAction.fetch().getDataObject());
  }

}
